package com.cadre.web.controller.officer;

import com.cadre.common.utils.R;
import com.cadre.system.domain.officer.PersonRelation;
import com.cadre.system.service.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

@Api(tags = {"人员管理接口"})
@RequestMapping({"/person"})
@RestController
/* loaded from: PersonController.class */
public class PersonController {
    @Resource
    private PersonService personService;
    @Resource
    private EduService eduService;
    @Resource
    private FamilyService familyService;
    @Resource
    private ResumeService resumeService;
    @Resource
    private ProfessService professService;
    @Resource
    private RewardService rewardService;
    @Resource
    private TrainService trainService;
    @Resource
    private AssessService assessService;
    @Resource
    private PersonRelationService personRelationService;

    @RequestMapping(value = {"/list"}, method = {RequestMethod.POST})
    @ApiOperation("人员列表")
    public R list(@RequestParam Map<String, Object> map) {
        return R.ok().put("page", (Object) this.personService.selectList(map));
    }

    @RequestMapping(value = {"/listByUnit"}, method = {RequestMethod.POST})
    @ApiOperation("人员列表（不分页）")
    public R listByCondition(String unitid) {
        return R.ok().put("data", (Object) this.personService.selectListByUnitid(unitid));
    }

    @RequestMapping(value = {"/selectNextDetail"}, method = {RequestMethod.POST})
    @ApiOperation("人员(下一条)flowid")
    public R selectNextDetail(@RequestBody Map<String, Object> map) {
        return R.ok().put("flowid", (Object) this.personService.selectNextDetail(map));
    }

    @RequestMapping(value = {"/info"}, method = {RequestMethod.GET})
    @ApiOperation("人员信息详情")
    public R info(String flowid) {
        return R.ok().put("data", (Object) this.personService.info(flowid));
    }

    @RequestMapping(value = {"/edu"}, method = {RequestMethod.GET})
    @ApiOperation("教育信息 ")
    public R edu(String personid, String A0449) {
        return R.ok().put("data", (Object) this.eduService.eduinfo(personid, A0449));
    }

    @RequestMapping(value = {"/faInfo"}, method = {RequestMethod.GET})
    @ApiOperation("家庭成员 ")
    public R faInfo(String personid) {
        return R.ok().put("data", (Object) this.familyService.familyinfo(personid));
    }

    @RequestMapping(value = {"/resume"}, method = {RequestMethod.GET})
    @ApiOperation("简历信息 ")
    public R resume(String personid) {
        return R.ok().put("data", (Object) this.resumeService.resumeMsg(personid));
    }

    @RequestMapping(value = {"/proInfo"}, method = {RequestMethod.GET})
    @ApiOperation("专业技术 ")
    public R proInfo(String personid) {
        return R.ok().put("data", (Object) this.professService.proMsg(personid));
    }

    @RequestMapping(value = {"/rewInfo"}, method = {RequestMethod.GET})
    @ApiOperation("奖惩信息 ")
    public R rewInfo(String flowid) {
        return R.ok().put("data", (Object) this.rewardService.rewardMsg(flowid));
    }

    @RequestMapping(value = {"/traInfo"}, method = {RequestMethod.GET})
    @ApiOperation("培训信息 ")
    public R traInfo(String personid) {
        return R.ok().put("data", (Object) this.trainService.trainMsg(personid));
    }

    @RequestMapping(value = {"/assInfo"}, method = {RequestMethod.GET})
    @ApiOperation("考核信息")
    public R assInfo(String personid) {
        return R.ok().put("data", (Object) this.assessService.assessMsg(personid));
    }

    @RequestMapping(value = {"/relationInfo"}, method = {RequestMethod.GET})
    @ApiOperation("人物关系")
    public R relationInfo(String personid) {
        long time1 = System.currentTimeMillis();
        PersonRelation relation = this.personRelationService.getRelation(personid);
        System.out.println((System.currentTimeMillis() - time1) + "%%%%%%%%%%%%%%%%%%%%%%%%%%%");
        return R.ok().put("data", (Object) relation);
    }

    @RequestMapping(value = {"/relationInfos/{tag}"}, method = {RequestMethod.GET})
    @ApiOperation("人物关系优化")
    public R relationInfos(@PathVariable("tag") String tag, String personid) {
        long time1 = System.currentTimeMillis();
        PersonRelation relation = this.personRelationService.getRelation(personid, tag);
        System.out.println((System.currentTimeMillis() - time1) + "%%%%%%%%%%%%%%%%%%%%%%%%%%%");
        return R.ok().put("data", (Object) relation);
    }
}
